package com.game.server.db;

import java.io.File;
import java.io.IOException;

import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;

import com.game.server.IConfig;


public class DBConfig implements IConfig {

	@Override
	public void init(String path) throws JDOMException, IOException {

		SAXBuilder builder = new SAXBuilder();
		Document doc = builder.build(new File(path));
		Element foo = doc.getRootElement();
		DBConfig.driver = foo.getChild("driver").getText();
		DBConfig.url = foo.getChild("url").getText();
		DBConfig.user = foo.getChild("user").getText();
		DBConfig.password = foo.getChild("password").getText();
	}

	@Override
	public void finish() throws ClassNotFoundException, InstantiationException,
			IllegalAccessException {
		// TODO Auto-generated method stub
	}


	public static String driver = "com.mysql.cj.jdbc.Driver";

	public static String url = "jdbc:mysql://127.0.0.1:3306/xuanxuanyouquan?useUnicode=true&amp;characterEncoding=utf-8&amp;useSSL=false&amp;serverTimezone=GMT%2B8";

	public static String user = "root";


	public static String password = "root";


	public static int MaximumPoolSize = 200;

	public static int MaxLifetime = 1800000;



}
